/**
 * Created by shc@lierda.com on 2017/2/22.
 */
var React = require('react');
var ProductImg = require('../components/ProductImg');
var ProductProcess = require('../components/ProductProcess');
var ajax = require('../tools/ajax');

module.exports = React.createClass({
    getInitialState: function (){
        return {
            list:[],
        }
    },
    componentDidMount: function () {
        this.getRenwu();
    },
    getRenwu(){
        var p =this;
        ajax("POST","getRenwu",{},function(dt){
            if(dt&&dt.success){
                var objs = dt.data;
                console.log(objs);
                var list = objs.map(function(obj,index) {
                    console.log(obj);
                    return (
                        <div key={index} className="product_item" style={{borderTop:index?"1px solid #CCCCCC":"none"}}>
                            <ProductImg data={obj.photo_xq} img={obj.photo} goods_id={obj.goods_id}></ProductImg>
                            <div className="product-dec">
                                <p>{obj.description}</p>
                            </div>
                        </div>
                    )
                });
                p.setState({list:list});
            }
        })
    },
    render: function () {
        return (
            <div style={{minHeight:"31.16rem"}}>
                {this.state.list}
            </div>
        )
    }
});
